package IO;

import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;
public class Test {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos= new FileOutputStream("./File/note.txt",true);
            String y;
        Scanner scanner =new Scanner(System.in);
       /* do {
        }while ((!y.equals("exit")));*/
        while (true){
            System.out.println("请输入单词(输入q退出):");
            y= scanner.nextLine();
//            if(!"exit".equals(y)){
            if(!"exit".equalsIgnoreCase(y)){  //equalsIgnoreCase:忽略大小写对比

                fos.write(y.getBytes(StandardCharsets.UTF_8));
            }else {
                System.out.println("已退出！！");
                break;
            }
        }
        fos.close();



    }
}
